/**
 * Created by zzp on 2017/5/31 0031.
 */
(function ($) {

    $.ajax({
        url: "user/getMenu",
        type: "post",
        async: "false",
        data: { userid: localStorage.getItem("token")},
        success: function (msg) {
            var str="";
            $.each(msg,function(x,y){
                if(y.id=="11"){//投资
                    str+="<a href=\'invest.html\' class=\'weui-tabbar__item iconcheck\'>"
                    str+="        <div class=\'weui-tabbar__icon\'>"
                    str+="            <i class=\'iconfont icon-wodedingdan\'></i>"
                    str+="        </div>"
                    str+="        <p class=\'weui-tabbar__label\'>投资</p>"
                    str+="    </a>"
                }else if(y.id=="12"){//申请
                    str+="    <a href=\'approve.html\' class=\'weui-tabbar__item\'>"
                    str+="        <div class=\'weui-tabbar__icon\'>"
                    str+="            <i class=\'iconfont icon-edit\'></i>"
                    str+="        </div>"
                    str+="        <p class=\'weui-tabbar__label\'><span class=\'weui-badge\' id=\'pro_size1\'val=\'0\' style=\'position: absolute;    left: 3rem;bottom: 1.1rem;\'>0</span>申请</p>"
                    str+="    </a>"
                }else if(y.id=="13"){//我的
                    str+="    <a href=\'user.html\' class=\'weui-tabbar__item\'>"
                    str+="        <div class=\'weui-tabbar__icon\'>"
                    str+="            <i class=\'iconfont icon-account\'></i>"
                    str+="        </div>"
                    str+="        <p class=\'weui-tabbar__label\'>我的</p>"
                    str+="    </a>"
                }

            });
            $(".weui-tabbar").append(str);
        }
    })
    $.ajax({
        url: "rzRelease/getTaskMoneyCount",
        type: "post",
        async: "false",
        data: { token: localStorage.getItem("token")},
        success: function (msg) {

            $("#pro_size1").html(msg);
            $("#pro_size1").attr("val",msg);
        }
    })

    /*var member_category = localStorage.getItem("member_category");
    if (member_category != null && member_category != '' && member_category != "undefined") {
        var str="";
        str+="<a href=\'touzi.html\' class=\'weui-tabbar__item\'>"
        str+="        <div class=\'weui-tabbar__icon\'>"
        str+="            <i class=\'iconfont icon-wodedingdan\'></i>"
        str+="        </div>"
        str+="        <p class=\'weui-tabbar__label\'>投资</p>"
        str+="    </a>"
        if(member_category!=0){
            str+="    <a href=\'approve.html\' class=\'weui-tabbar__item\'>"
            str+="        <div class=\'weui-tabbar__icon\'>"
            str+="            <i class=\'iconfont icon-edit\'></i>"
            str+="        </div>"
            str+="        <p class=\'weui-tabbar__label\'>申请</p>"
            str+="    </a>"
        }
        str+="    <a href=\'user.html\' class=\'weui-tabbar__item iconcheck\'>"
        str+="        <div class=\'weui-tabbar__icon\'>"
        str+="            <i class=\'iconfont icon-account\'></i>"
        str+="        </div>"
        str+="        <p class=\'weui-tabbar__label\'>我的</p>"
        str+="    </a>"
        $(".weui-tabbar").append(str);
    } else {
        $.toast("请登录");
        setTimeout(function() {
            window.location.href = "login.html";
        }, 1000);
    }*/
})(jQuery);